package com.yy.shardingsphere.service.impl;

import com.yy.shardingsphere.dao.UserMapper;
import com.yy.shardingsphere.service.UserService;
import com.yy.shardingsphere.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yangyao
 * @Description: UserServiceImpl
 * @date 2018/11/1 16:00
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void save(User user) {
        this.userMapper.save(user);
    }

    @Override
    public User getUserByUserId(Long userId) {
        return this.userMapper.getUserByUserId(userId);
    }

    @Override
    public List<User> getAllUsers() {
        return this.userMapper.getAllUsers();
    }
}
